#include "pthreadPool.hpp"
#include <thread>

int main()
{
	ThreadPool<Task>* tp = new ThreadPool<Task>();
	ThreadPool<Task>::Initializer()->start();
	// tp->start();
	srand(time(nullptr) ^ getpid());
	while(true)
	{
		int x = rand() % 10 + 1;
		int y = rand() % 5;
		char op = opers[rand() % 5];
		Task t(x,y,op);
		ThreadPool<Task>::Initializer()->push(t);
		// tp->push(t);

		std::cout << "main thread make task,task : " << t.GetTask() << std::endl;
		sleep(1);
		// cout << "main thread is running ..." << endl;
	}
	std::thread tid;
	return 0;
}